package com.purang.web.view;

import com.purang.web.annotation.Permission;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/hello")
public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html");
        resp.getWriter().println("<h1>Hello World</h1>");
        resp.getWriter().println("<h1>username:"+ getServletContext().getInitParameter("username") +"</h1>");
        resp.getWriter().println("<h1>password:"+ getServletContext().getInitParameter("password") +"</h1>");
    }
}